import React from 'react';
import CustomNavBar from '../CustomNavBar';
import styles from './index.less';

const PageWrap = ({ title, navbarProps, isFixed = true, children, footer, ...rest }) => (
    <div className={styles.blankPage} {...rest}>
        {title && (
            <CustomNavBar {...navbarProps} isFixed={isFixed}>
                {title}
            </CustomNavBar>
        )}
        <div style={{ paddingTop: title && isFixed ? 44 : 0, paddingBottom: footer ? 60 : 0 }}>{children}</div>
        {footer && <div className={styles.pageFooter}>{footer}</div>}
    </div>
);

export default PageWrap;
